package com.rtwo.tio.client.handler;

import com.rtwo.tio.common.BasicHandler;
import com.rtwo.tio.server.msg.P2PResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tio.core.ChannelContext;
import org.tio.utils.json.Json;

import java.io.UnsupportedEncodingException;

/**
 * Created by hasee on 2018/7/19.
 */
public class P2PRequestHandler extends BasicHandler<P2PResponse>{

    private static Logger logger = LoggerFactory.getLogger(P2PRequestHandler.class);

    @Override
    public Class<P2PResponse> getClazz() {
        return P2PResponse.class;
    }

    @Override
    public void postHanlder(P2PResponse body, ChannelContext channelContext) throws UnsupportedEncodingException {
        logger.error("收到P2P响应消息:" + Json.toJson(body));
    }
}
